//
//  BLClothShareViewController.m
//  blanket
//
//  Created by Mac on 2017/12/6.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "BLClothShareViewController.h"
#import "BLClothRecicalViewController.h"
#import "BLHotelshareViewController.h"
@interface BLClothShareViewController ()

@end

@implementation BLClothShareViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.backgroundColor = [UIColor whiteColor];
    self.title = @"酒店布草共享";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 100)];
    header.backgroundColor = [UIColor whiteColor];
    
    
    STButton * sharesButton = [[STButton alloc] initWithFrame:CGRectMake(30, 130, UIScreenWidth - 60, 60)
                                                        title:@"酒店布草共享"
                                                   titleColor:[UIColor whiteColor]
                                                    titleFont:16
                                                 cornerRadius:5
                                              backgroundColor:BL_BlueBackGroundColor
                                              backgroundImage:nil
                                                        image:nil];
    sharesButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [header addSubview:sharesButton];
    
    STButton * reduceButton = [[STButton alloc] initWithFrame:CGRectMake(30, sharesButton.bottom + 40, UIScreenWidth - 60, 60)
                                                        title:@"布草回收站"
                                                   titleColor:BL_BlueBackGroundColor
                                                    titleFont:16
                                                 cornerRadius:5
                                              backgroundColor:[UIColor whiteColor]
                                              backgroundImage:nil
                                                        image:nil];
    reduceButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [header addSubview:reduceButton];
    [reduceButton st_setBorderWith:1 borderColor:BL_BlueBackGroundColor cornerRadius:5];
    __weak typeof(self) weakSelf =  self;
    
    UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, reduceButton.bottom + 50, 80, 80)];
    imageView.centerX = UIScreenWidth / 2;
    imageView.image = [UIImage imageNamed:@"底图logo"];
    [header addSubview:imageView];
    
    header.height = imageView.bottom ;
    self.tableView.tableHeaderView = header;
    [sharesButton setClicAction:^(UIButton *sender) {
        [weakSelf onSelectedsharesButton];
    }];
    [reduceButton setClicAction:^(UIButton *sender) {
        [weakSelf onSelectedReduceButton];
    }];
}
#pragma mark --Action Method
- (void)onSelectedsharesButton{
    
    [self.navigationController pushViewController:[BLHotelshareViewController new] animated:YES];
}
- (void)onSelectedReduceButton{
    [self.navigationController pushViewController:[BLClothRecicalViewController new] animated:YES];
}
@end

